﻿/*!	@file	r_input_device.h
	@brief	入力装置
Copyright (c) 2009 Yuya Yamaguchi

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#ifndef _R_INPUT_DEVICE_H_
#define _R_INPUT_DEVICE_H_

#include "../rtti/r_rtti_class_base.h"

namespace r{
	namespace input{
		//! 入力デバイス状態
		/*!
		*/
		class Device : public r::rtti::ClassBase
		{
			RRTTI_REFLECTION_DECLARE
		public:
			//! コンストラクタ
			Device();
			//! デストラクタ
			virtual ~Device();
		public:
			//! このデバイスが接続されているかの取得
			/*!
			*/
			r_bool			getIsConnectDevice ( void ) const;
		protected:
			//! キー入力開始
			/*!
			*/
			virtual void	beginInput ( void ) {}
			//! キー入力終了、入力状況を基に簡単に取り出し可能なキー情報を作成
			/*!
			*/
			virtual void	endInput ( void ) {}
		protected:
			//! デバイスが接続されているかを設定
			/*!
			*/
			virtual void	setIsConnect ( r_bool enable );
		protected:
			//! 初期化
			/*! 全てのキーを初期状態にします
			*/
			virtual void	init ( void ) {}
		protected:
			r_bool			isConnected;			//!< 接続状態
			r_bool			isActive;				//!< 入力の有/無効果
		};

	}
}

#endif // _R_INPUT_DEVICE_H_
